/**
 * 
 */
package com.guohong.service.impl;

import java.util.Date;

import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.guohong.entity.Permission;
import com.guohong.mapper.PermissionMapper;
import com.guohong.service.PermissionService;
import com.guohong.vo.PermissionVo;

/**
 * @author mao_g
 *
 */
@Service
public class PermissionServiceImpl implements PermissionService {
	@Autowired
	private PermissionMapper permissionMapper;

	@Transactional
	@Override
	public int insert(PermissionVo permissionVo) {
		Permission permission = new Permission();
		BeanUtils.copyProperties(permissionVo, permission);
		
		permission.setCreateUser("admin");
		permission.setCreateTime(new Date());

		return permissionMapper.insert(permission);
	}

}
